<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图片列表</title>
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../css/block-list.css">
</head>
<body>
<div id="content">
    <div class="img-list">
        <script type="text/html" id="listTemp">
            {{each}}
                <div class="list-item {{$index===0 && 'active'}}">
                    <div class="item-wrap">
                        <!--<img class="img" src="{{$imports.CONFIG.IMAGE_RESOURCES_ADDRESS+$value.pictures}}" alt="">-->
                        <div class="name">{{$value.titleName}}</div>
                    </div>
                </div>
            {{/each}}
        </script>
    </div>
</div>
<div id="page"></div>

</body>
<script src="../js/S.js"></script>
<script src="../js/common.js"></script>
<script src="../js/tvProcess.js"></script>
<script src="../js/template-web.js"></script>
<script src="../js/list.js"></script>
<script>

    keyopt.options.focusElm="listItem1";
    var newsList = new List({
        action: 'getGovOpenStairColumnListV10',
        tempId: 'listTemp',
//        direction: 'horizontal',//horizontal水平排列
        col:5,
        params: {
            menuId: '11161354248390008',
            pageSize: 20
        },
        callback: function (data) {
            newsList.setListGoBottom('nextBtn')
            //绝对定位
            //每个元素宽高
            var height = 104,
                width = 216;
            //每个元素偏移间隔
            var offsetTop = 4, offsetLeft = 15;
            //总行数，总列数
            var rowNum = 1, colNum = 5;
            var curRow, curCol;
            for (var i = 0; i < newsList.getNodeCache().length; i++) {
                curRow = Math.floor(i / colNum);
                curCol = i % colNum;
                console.log(curRow, curCol);
                newsList.getNodeCache()[i].style.top = (height + offsetTop) * curRow+'px';
                newsList.getNodeCache()[i].style.left = (width + offsetLeft) * curCol+'px';
            }
        }
    });
    newsList.setParams({stairColumnId: '1129132720190004'}).getData().addPageControl();

</script>
</html>